import request from "@/utils/request";


//请求
export function list(params) {
    return request.get('/api/devices/list',{ params});
}


//json
export function update(data) {
    return request.put('/api/devices/addorupdate', data);
}

export function updatestatus(data) {
    return request.put('/api/devices/status', data);
}


//路劲参数
export function remove(id) {
    return request.delete(`/api/devices/remove/${id}`);
}

//json格式
export function batchDelete(ids) {
    return request.delete(`/api/devices/batchDelete`, {
        data: ids // 直接传递 ID 数组作为请求体（与后端 @RequestBody List<Integer> 匹配）
    });

}

export function getparams(requestData){
    return request.get(`/api/devices/getparams`,
        {params:requestData}
    )
}

export function getParamNamesByDeviceId(deviceId){
    return request.get(`/api/devices/getParamNamesByDeviceId`,
        {params:{deviceId:deviceId}}
    )
}

export function gethealthStats(){
    return request.get('/api/devices/gethealthStats')
}

export function  getHighRisk(deviceId){
    return request.get('/api/devices/getHighRisk', {params: {deviceId}})
}